﻿export default [
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './user/login',
      },
    ],
  },
  {
    path: '/',
    component: '../layouts/SecurityLayout',
    routes: [
      {
        path: '/',
        component: '../layouts/BasicLayout',
        authority: ['admin', 'user'],
        routes: [
          {
            path: '/',
            redirect: '/welcome',
          },
          {
            path: '/welcome',
            name: 'welcome',
            icon: 'smile',
            component: './Welcome',
          },
          // 订单管理
          {
            path: '/order',
            name: 'order',
            icon: 'AlignLeftOutlined',
            authority: ['agency'],
            // component: './Order/index',
            routes: [
              {
                path: '/order/powerline',
                name: 'powerline',
                component: './OrderPowerline/index'
              },
              {
                path: '/order/cabinet',
                name: 'cabinet',
                component: './OrderCabinet/index'
              }
            ]
          },
          // 商户管理
          {
            path: '/seller',
            name: 'seller',
            icon: 'TeamOutlined',
            authority: ['agency'],
            component: './Seller/index'
          },
          // 设备管理
          {
            path: '/device',
            name: 'device',
            icon: 'UngroupOutlined',
            authority: ['agency'],
            routes: [
              {
                path: '/device/cabinet',
                name: 'cabinet',
                component: './Cabinet/index'
              },
              {
                path: '/device/powerline',
                name: 'powerline',
                component: './Powerline/index'
              }
            ]
          },
          // 统计报表
          {
            path: '/statistic',
            name: 'statistic',
            icon: 'BookOutlined',
            authority: ['agency'],
            routes: [
              {
                path: '/statistic/seller',
                name: 'seller',
                component: './SellerStatistic/index'
              }
            ]
          },
          {
            path: '/admin',
            name: 'admin',
            icon: 'crown',
            component: './Admin',
            authority: ['admin'],
            routes: [
              {
                path: '/admin/sub-page',
                name: 'sub-page',
                icon: 'smile',
                component: './Welcome',
                authority: ['admin'],
              },
            ],
          },
          {
            component: './404',
          },
        ],
      },
      {
        component: './404',
      },
    ],
  },
  {
    component: './404',
  },
];
